package com.serkol.abmanager.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.serkol.abmanager.entity.AdminToken;
import com.serkol.abmanager.service.AdminTokenService;
import com.serkol.abmanager.mapper.AdminTokenMapper;
import org.springframework.stereotype.Service;

/**
 *
 */
@Service
public class AdminTokenServiceImpl extends ServiceImpl<AdminTokenMapper, AdminToken>
        implements AdminTokenService {

    @Override
    public AdminToken isLogin(String token) {
        QueryWrapper<AdminToken> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(AdminToken::getToken, token).eq(AdminToken::getState, 0);
        AdminToken one = this.getOne(queryWrapper);
        return one;
    }
}




